home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
graphics
/
amicad
/
arexx_english
/
align.amicad
< prev
next >
Wrap
Text File
|
1999-12-06
|
1KB
|
59 lines
/* $VER: Align.AmiCAD 1.02e (© R.Florac, 23 mai 1999) */
options results
signal on error
signal on syntax
'ALIGNEMENT=SELECT("Alignment"+CHR(10)+"Top"+CHR(10)+"Bottom"+CHR(10)+"Left"+CHR(10)+"Right")'
alignement=result
select
when alignement=1 then ligne_base=50000
when alignement=2 then ligne_base=0
when alignement=3 then colonne_base=50000
when alignement=4 then colonne_base=0
otherwise exit
end
objets=0
'FIRSTSEL'; i=result
do while i>0
objets=objets+1
'LINE('i')'; ligne=result
'COL('i')'; colonne=result
select
when alignement = 1 then do
if ligne<ligne_base then ligne_base=ligne
end
when alignement = 2 then do
if ligne>ligne_base then ligne_base=ligne
end
when alignement = 3 then do
if colonne<colonne_base then colonne_base=colonne
end
otherwise do
if colonne>colonne_base then colonne_base=colonne
end
end
'NEXTSEL('i')'; i=result
end
'CD='colonne_base':O=FIRSTSEL'; i=result
if alignement=4 then do
'SAVEALL(-1):O=FIRSTSEL:WHILE(O,MOVE(O,CD-COL(O)-WIDTH(O),0):O=NEXTSEL(O))'
exit
end
'SAVEALL(-1):O=FIRSTSEL:WHILE(O,IF(ALIGNEMENT<3,MOVE(O,0,'ligne_base'-LINE(O)),MOVE(O,'colonne_base'-COL(O),0)):O=NEXTSEL(O))'
exit
syntax:
erreur=RC
'MESSAGE("Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
exit
error:
'MESSAGE("Error in line 'SIGL'")'
exit